<%--
Created by IntelliJ IDEA.
User: baiyu
Date: 2021/9/21
Time: 4:10 上午
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" %>

<html>
<head>
    <title>$Title$</title>
    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
    <script type="application/javascript">
        function getAllUrl() {
            $.ajax({
                type: 'post',
                url: "<%=request.getContextPath()%>/action/getAllUrl",
                data: {
                    "req": document.getElementById("test_text").value,
                },
                success: function (resp) {
                    debugger;
                    document.getElementById("test_text").value = resp;
                },
                error: function (resp) {
                    alert("报错了");
                    console.log(resp);
                }
            });
        }
        function deleteAllUrl(){
            $.ajax({
                type: 'post',
                url: "<%=request.getContextPath()%>/action/deleteAllUrl",
                data: {
                    "req": document.getElementById("test_text").value,
                },
                success: function (resp) {
                    debugger;
                    document.getElementById("test_text").value = resp;
                },
                error: function (resp) {
                    alert("报错了");
                    console.log(resp);
                }
            });
        }
    </script>
</head>
<body>
<%=request.getContextPath()%>
<hr/>
<div>
    <button type="button" onclick="getAllUrl()">获取全部</button>
    <button type="button" onclick="deleteAllUrl()">删除全部</button>
</div>
<div>
    <label for="test_text">我也不知道这是啥</label>
    <textarea rows="100" cols="100" id="test_text"></textarea>
</div>
</body>
</html>